package pers.mobian.springforth;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Date 2021/7/10 19:51
 * @Created mobian
 * @Description
 */

//@Component
public class UserService {

//	@Name("mobian")
//	private String name;


//	public void show() {
//		System.out.println("名字是：" + name);
//	}

	private User user;

//	public UserService() {
//		System.out.println("0个参数的构造方法");
//		this.user = user;
//	}


	// 当参数是一个的时候，我们

	@Autowired(required = false)
	public UserService(User user,User user2) {
		System.out.println("两个参数的构造方法");
		this.user = user;
	}


	@Autowired(required = false)
	public UserService(User user, Person person) {
		System.out.println("一个参数的构造方法");
		this.user = user;
	}


}
